//
//  GroupModel.m
//  SinaWeibo
//
//  Created by Apple on 16/8/21.
//  Copyright © 2016年 Apple. All rights reserved.
//

#import "GroupModel.h"

@implementation GroupModel

/**
 *  重写set方法用于改变图片质量数组里面的值
 *
 *  @param indexPath 当前图片质量View选中的indexPath
 */
-(void)setIndex:(NSInteger)index{
    
    for (int i=0 ; i<self.items.count ; i++) {
        
        ItemPictureQualityModel *item = self.items[i];
        
        if (index == i) {
            
            item.isCheck = YES;
            
        }else{
            
            item.isCheck = NO;
        }
    }
    
}

+(instancetype) groupWithItems:(NSArray *)items{
    
    GroupModel *group = [[self alloc]init];
    
    group.items = items;
    
    return group;
}

@end
